package com.zyl.blog.common.domain.rbac.dto;

import com.zyl.blog.common.domain.rbac.enums.AuthType;
import jakarta.validation.constraints.NotBlank;
import lombok.With;
import org.springframework.validation.annotation.Validated;

/**
 * @version v1.0
 * @ProjectName: Personal_Blog
 * @Package: com.zyl.common.domain.rbac.dto
 * @ClassName: LoginDTO
 * @Description: 用户登录传输对象DTO
 * @Author FinalFantasy
 * @Date 2025/6/24-13:04
 */
@Validated
@With
public record LoginDTO(

        @NotBlank(message = "用户名或邮箱不能为空")
        String identifier,

        @NotBlank(message = "认证标签不能为空")
        String tag,

        @NotBlank(message = "密码不能为空")
        String password
) {

        public AuthType getAuthType() {
                return AuthType.of(tag);
        }
}
